import request from "@/utils/request";

export function fetchList(query) {
    return request({
        url: "/device/api/deviceAsset/query/page",
        method: "get",
        params: Object.assign({ state: 13 }, query)
    });
}
export function fetchListInDevice(query) {
    return request({
        url: "/device/api/deviceAsset/query/page",
        method: "get",
        params: query
    });
}
export function fetchBroadInfo(query) {
    return request({
        url: "/device/api/assetField/query/list",
        method: "get",
        params: query
    });
}
//保存设备信息
export function saveDeviceInfo(query) {
    return request({
        url: "/device/api/deviceAsset",
        method: "post",
        data: query
    });
}
//更新设备信息
export function updateDeviceInfo(query) {
    return request({
        url: "/device/api/deviceAsset",
        method: "put",
        data: query
    });
}
//设备详细信息
export function fetchDetailInfo(query) {
    return request({
        url: "/device/api/deviceAsset/query/" + query,
        method: "get"
    });
}
//导出
export function exportFile(params) {
    console.log(params);
    return request({
        url: "/device/api/deviceAsset/export",
        method: "post",
        data: params
    });
}
//批量导入
export function importFile() {
    return request({
        url: "/device/api/deviceAsset/import",
        method: "post"
            //data: params
    });
}
//下载导入模板

export function downloadTemplete(query) {
    return request({
        url: "/device/api/deviceAsset/download/template",
        method: "get"
            //params: query
    });
}
//删除台账
export function deleteDeviceInfo(query) {
    return request({
        url: "/device/api/deviceAsset/" + query,
        method: "delete"
            //data: query
    });
}
//启用设备
export function useInfo(id) {
    return request({
        url: `/device/api/deviceAsset/start/${id}`,
        method: "put"
            //data: query
    });
}
//停用

export function uselessInfo(id) {
    return request({
        url: `/device/api/deviceAsset/stop/${id}`,
        method: "put"
            //data: query
    });
}
//档案资料
export function fetchHistoryInfo(id) {
    return request({
        url: `/device/api/assetArchive/query/list/${id}`,
        method: "get"
            //data: query
    });
}
//下载标识卡
export function downloadIdentify(args) {
    return request({
        url: "/composition/deviceAsset/identityCard",
        method: "post",
        data: args
    });
}